package com.clever.springssm.mapper;

import com.clever.springssm.entity.Carts;
import com.clever.springssm.vo.CartsVo;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * @author ChenWang
 * @interfaceName CartsMapper
 * @date 2020/10/30 14:54
 * @since JDK 1.8
 */
public interface CartsMapper {
    int insert(@Param("carts")Carts carts);

    Carts selectByUserIdAndProductId(@Param("userId") int userId,@Param("productId") int productId);

    int updateById(@Param("cartId")int cartId,@Param("quantity")int quantity);

    List<Carts> selectAllByUserId(@Param("userId")int userId);

    int delCartsById(@Param("cartsIds") List<Integer> cartsIds);

}
